]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
overview: Remove contacts search provider
authorFlorian Müllner <fmuellner@gnome.org>
Mon, 11 Jun 2012 13:16:33 +0000 (15:16 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Fri, 29 Jun 2012 09:21:50 +0000 (11:21 +0200)
With gnome-contacts implementing a remote search provider, the
built-in contacts search is now unnecessary duplication; remote it.

https://bugzilla.gnome.org/show_bug.cgi?id=677442

data/theme/gnome-shell.css
js/Makefile.am
js/ui/contactDisplay.js [deleted file]
js/ui/overview.js

index eb854215dcef198bfffd13401fb8214b02d93abb..73c86e20de229fe49d265c2e12521b9583d53037 100644 (file)
@@ -803,63 +803,6 @@ StScrollBar StButton#vhandle:hover
     transition-duration: 100;
 }
 
-/* Contacts */
-
-.contact-grid {
-    spacing: 36px;
-    -shell-grid-horizontal-item-size: 272px; /* 2 * -shell-grid-horizontal-item-size + spacing */
-    -shell-grid-vertical-item-size: 118px;
-}
-
-.contact {
-    width: 272px; /* Same width as two normal results + spacing */
-    height: 118px; /* Aspect ratio = 1.75. Normal US business card ratio */
-    border-radius: 4px;
-    padding: 3px;
-    border: 1px rgba(0,0,0,0);
-    transition-duration: 100;
-}
-
-.contact-content {
-    border-radius: 7px;
-    padding: 8px;
-    width: 232px;
-    height: 84px;
-    background-color: rgba(0.0, 0.0, 0.0, 0.5);
-    color: white;
-}
-
-.contact-icon {
-    border-radius: 4px;
-}
-
-.contact-details {
-    padding: 0px 6px 22px 10px;
-}
-
-.contact-details-alias {
-    font-size: 18px;
-    padding-bottom: 8px;
-}
-
-.contact-details-status-icon {
-    padding-right: 4px;
-}
-
-.contact:hover {
-    background-color: rgba(255,255,255,0.1);
-    transition-duration: 100;
-}
-
-.contact:focus,
-.app-well-app:focus > .overview-icon,
-.search-result-content:focus > .overview-icon,
-.contact:selected,
-.app-well-app:selected > .overview-icon,
-.search-result-content:selected > .overview-icon {
-    background-color: rgba(255,255,255,0.33);
-}
-
 /* LookingGlass */
 
 #LookingGlassDialog
index fd0e925fa9326ebae95ca86df453104b35126ff5..0b98cbdc6c1308c033fcb68211b7e921cb035539 100644 (file)
@@ -43,7 +43,6 @@ nobase_dist_js_DATA =         \
        ui/boxpointer.js        \
        ui/calendar.js          \
        ui/checkBox.js          \
-       ui/contactDisplay.js \
        ui/ctrlAltTab.js        \
        ui/dash.js              \
        ui/dateMenu.js          \
diff --git a/js/ui/contactDisplay.js b/js/ui/contactDisplay.js
deleted file mode 100644 (file)
index 6cbc598..0000000
+++ /dev/null
@@ -1,196 +0,0 @@
-// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
-
-const Folks = imports.gi.Folks
-const Lang = imports.lang;
-const Meta = imports.gi.Meta;
-const Shell = imports.gi.Shell;
-const St = imports.gi.St;
-const Atk = imports.gi.Atk;
-
-const Util = imports.misc.util;
-const IconGrid = imports.ui.iconGrid;
-const Search = imports.ui.search;
-const SearchDisplay = imports.ui.searchDisplay;
-
-const MAX_SEARCH_RESULTS_ROWS = 1;
-const ICON_SIZE = 81;
-
-function launchContact(id) {
-    Util.spawn(['gnome-contacts', '-i', id]);
-}
-
-
-/* This class represents a shown contact search result in the overview */
-const Contact = new Lang.Class({
-    Name: 'Contact',
-
-    _init: function(id) {
-        this._contactSys = Shell.ContactSystem.get_default();
-        this.individual = this._contactSys.get_individual(id);
-
-        this.actor = new St.Bin({ style_class: 'contact',
-                                  reactive: true,
-                                  can_focus: true,
-                                  track_hover: true,
-                                  accessible_role: Atk.Role.PUSH_BUTTON });
-
-        let content = new St.BoxLayout( { style_class: 'contact-content',
-                                          vertical: false });
-        this.actor.set_child(content);
-
-        let icon = new St.Icon({ icon_type: St.IconType.FULLCOLOR,
-                                 icon_size: ICON_SIZE,
-                                 style_class: 'contact-icon' });
-        if (this.individual.avatar != null)
-            icon.gicon = this.individual.avatar;
-        else
-            icon.icon_name = 'avatar-default';
-
-        content.add(icon, { x_fill: true,
-                            y_fill: false,
-                            x_align: St.Align.START,
-                            y_align: St.Align.MIDDLE });
-
-        let details = new St.BoxLayout({ style_class: 'contact-details',
-                                         vertical: true });
-        content.add(details, { x_fill: true,
-                               y_fill: false,
-                               x_align: St.Align.START,
-                               y_align: St.Align.MIDDLE });
-
-        let email = this._contactSys.get_email_for_display(this.individual);
-        let aliasText = this.individual.alias     ||
-                        this.individual.full_name ||
-                        this.individual.nickname  ||
-                        email                     ||
-                        C_("contact", "Unknown");
-        let aliasLabel = new St.Label({ text: aliasText,
-                                        style_class: 'contact-details-alias' });
-        details.add(aliasLabel, { x_fill: true,
-                                  y_fill: false,
-                                  x_align: St.Align.START,
-                                  y_align: St.Align.START });
-
-        this.actor.label_actor = aliasLabel;
-
-        let presence = this._createPresence(this.individual.presence_type);
-        details.add(presence, { x_fill: false,
-                                y_fill: true,
-                                x_align: St.Align.START,
-                                y_align: St.Align.END });
-    },
-
-    _createPresence: function(presence) {
-        let text;
-        let iconName;
-
-        switch(presence) {
-          case Folks.PresenceType.AVAILABLE:
-            text = _("Available");
-            iconName = 'user-available';
-            break;
-          case Folks.PresenceType.AWAY:
-          case Folks.PresenceType.EXTENDED_AWAY:
-            text = _("Away");
-            iconName = 'user-away';
-            break;
-          case Folks.PresenceType.BUSY:
-            text = _("Busy");
-            iconName = 'user-busy';
-            break;
-          case Folks.PresenceType.OFFLINE:
-            text = _("Offline");
-            iconName = 'user-offline';
-            break;
-          default:
-            text = '';
-            iconName = null;
-          }
-
-        let box = new St.BoxLayout({ vertical: false,
-                                     style_class: 'contact-details-status' });
-
-        if (iconName) {
-            let icon = new St.Icon({ icon_name: iconName,
-                                     icon_type: St.IconType.FULLCOLOR,
-                                     icon_size: 16,
-                                     style_class: 'contact-details-status-icon' });
-            box.add(icon, { x_fill: true,
-                            y_fill: false,
-                            x_align: St.Align.START,
-                            y_align: St.Align.START });
-        }
-
-        let label = new St.Label({ text: text });
-
-        box.add(label, { x_fill: true,
-                         y_fill: false,
-                         x_align: St.Align.END,
-                         y_align: St.Align.START });
-
-        return box;
-    },
-
-    createIcon: function(size) {
-        let tc = St.TextureCache.get_default();
-        let icon = this.individual.avatar;
-
-        if (icon != null) {
-            return tc.load_gicon(null, icon, size);
-        } else {
-            return tc.load_icon_name(null, 'avatar-default', St.IconType.FULLCOLOR, size);
-        }
-    },
-});
-
-
-/* Searches for and returns contacts */
-const ContactSearchProvider = new Lang.Class({
-    Name: 'ContactSearchProvider',
-    Extends: Search.SearchProvider,
-
-    _init: function() {
-        this.parent(_("CONTACTS"));
-        this._contactSys = Shell.ContactSystem.get_default();
-    },
-
-    getResultMetas: function(ids, callback) {
-        let metas = [];
-        for (let i = 0; i < ids.length; i++) {
-            let contact = new Contact(ids[i]);
-            metas.push({ 'id': ids[i],
-                         'name': contact.alias,
-                         'createIcon': function(size) {
-                             return contact.createIcon(size);
-                         }
-                       });
-        }
-        callback(metas);
-    },
-
-    getInitialResultSet: function(terms) {
-        this.searchSystem.pushResults(this, this._contactSys.initial_search(terms));
-    },
-
-    getSubsearchResultSet: function(previousResults, terms) {
-        this.searchSystem.pushResults(this, this._contactSys.subsearch(previousResults, terms));
-    },
-
-    createResultActor: function(resultMeta, terms) {
-        let contact = new Contact(resultMeta.id);
-        return contact.actor;
-    },
-
-    createResultContainerActor: function() {
-        let grid = new IconGrid.IconGrid({ rowLimit: MAX_SEARCH_RESULTS_ROWS,
-                                             xAlign: St.Align.START });
-        grid.actor.style_class = 'contact-grid';
-
-        let actor = new SearchDisplay.GridSearchResults(this, grid);
-        return actor;
-    },
-
-    activateResult: function(id, params) {
-        launchContact(id);
-    }
-});
index 5221b58f85b56706ef185f7ebb7811395640f4b5..b73f37203909c31b005a0421dbba9dde129a1080 100644 (file)
@@ -1,7 +1,6 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
 const Clutter = imports.gi.Clutter;
-const Config = imports.misc.config;
 const Gtk = imports.gi.Gtk;
 const Meta = imports.gi.Meta;
 const Mainloop = imports.mainloop;
@@ -12,7 +11,6 @@ const Shell = imports.gi.Shell;
 const Gdk = imports.gi.Gdk;
 
 const AppDisplay = imports.ui.appDisplay;
-const ContactDisplay = Config.HAVE_FOLKS ? imports.ui.contactDisplay : null;
 const Dash = imports.ui.dash;
 const DND = imports.ui.dnd;
 const Main = imports.ui.main;
@@ -208,8 +206,6 @@ const Overview = new Lang.Class({
         this.addSearchProvider(new AppDisplay.AppSearchProvider());
         this.addSearchProvider(new AppDisplay.SettingsSearchProvider());
         this.addSearchProvider(new PlaceDisplay.PlaceSearchProvider());
-        if (ContactDisplay != null)
-            this.addSearchProvider(new ContactDisplay.ContactSearchProvider());
 
         // Load remote search providers provided by applications
         RemoteSearch.loadRemoteSearchProviders(Lang.bind(this, this.addSearchProvider));